import axios from "axios";

let instance = axios.create({
	timeout: 10000,
});

// 响应拦截器
instance.interceptors.response.use(
	(res) => res.data,
	(err) => Promise.reject(err)
);

export const get = (url, config = {}) => instance.get(url, config);

export const post = (url, data = {}, config = {}) =>
	instance.post(url, data, config);
